﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_SalePayEdit.aspx.cs" Inherits="CRM_Store_ERP_SalePayEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>销售点详情</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript" >
        function SaveClick(type) {
            if (FieldEmptyCheck2Trim(formPanel))
            {
                if (gridPanel_listdata.store.data.length > 0) {
                    Ext.net.DirectMethods.SaveData(type);
                }
                else
                    Ext.Msg.alert("系统提示", "请至少添加一条结算记录!");
            }
        }

    </script>
</head>
<body>
     <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <form id="form1" runat="server">
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout" >
        <Content>
            <ext:Panel runat="server" Border="false" Layout="RowLayout">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button ID="extBtn_Save" runat="server" Text="保存" Icon="Accept">
                                <Listeners>
                                    <Click Handler="SaveClick(0);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_SubmitInfo" runat="server" Text="提交" Icon="FolderGo">
                                <Listeners>
                                    <Click Handler="SaveClick(1);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_CheckInfo" runat="server" Text="审核" Icon="Lock">
                                <Listeners>
                                    <Click Handler="SaveClick(2);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_Exit" runat="server" Text="退出" Icon="Cancel">
                                <Listeners>
                                    <Click Fn="closeCurrTab" />
                                </Listeners>
                            </ext:Button>
                            <ext:ToolbarFill ID="ToolbarFill3" runat="server" />
                            <ext:FileUploadField ID="extFuf_ImportExcel" runat="server" ButtonOnly="true" ButtonText="从Excel导入" Icon="PageExcel" >
                                <Listeners>
                                    <FileSelected Handler="Ext.net.DirectMethods.ImportExcel();" />
                                </Listeners>
                            </ext:FileUploadField>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:Panel ID="formPanel" runat="server" Border="false" Padding="10" Height="102" Layout="ColumnLayout" >
                        <Items>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_PayNo" FieldLabel="销售单号" ReadOnly="true" AnchorHorizontal="0.95" />
                                    <ext:ComboBox runat="server" ID="extcomb_Saler"  FieldLabel="销售人员"
                                        DisplayField="USER_NAME" ValueField="USER_ID" TabIndex="10" AnchorHorizontal="0.95"  >
                                        <Store>
                                            <ext:Store runat="server" ID="Store_USER" AutoLoad="true">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="USER_ID">
                                                        <Fields>
                                                            <ext:RecordField Name="USER_ID" />
                                                            <ext:RecordField Name="USER_NAME" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                    </ext:ComboBox>
                                    <ext:CompositeField runat="server" FieldLabel="月份">
                                        <Items>
                                            <ext:ComboBox runat="server" ID="extcomb_year" Editable="false" TabIndex="2" 
                                            SelectOnFocus="true" AllowBlank="false" Width="80" >
                                                <Items>
                                                    <ext:ListItem Text="2016" Value="2016" />
                                                    <ext:ListItem Text="2017" Value="2017" />
                                                    <ext:ListItem Text="2018" Value="2018" />
                                                    <ext:ListItem Text="2019" Value="2019" />
                                                    <ext:ListItem Text="2020" Value="2020" />
                                                </Items>
                                            </ext:ComboBox>
                                            <ext:Label runat="server" Text="年"></ext:Label>
                                            <ext:ComboBox runat="server" ID="extcomb_month" Editable="false" TabIndex="3" 
                                            SelectOnFocus="true" AllowBlank="false" Width="80" >
                                                <Items>
                                                    <ext:ListItem Text="01" Value="01" />
                                                    <ext:ListItem Text="02" Value="02" />
                                                    <ext:ListItem Text="03" Value="03" />
                                                    <ext:ListItem Text="04" Value="04" />
                                                    <ext:ListItem Text="05" Value="05" />
                                                    <ext:ListItem Text="06" Value="06" />
                                                    <ext:ListItem Text="07" Value="07" />
                                                    <ext:ListItem Text="08" Value="08" />
                                                    <ext:ListItem Text="09" Value="09" />
                                                    <ext:ListItem Text="10" Value="10" />
                                                    <ext:ListItem Text="11" Value="11" />
                                                    <ext:ListItem Text="12" Value="12" />
                                                </Items>
                                            </ext:ComboBox>
                                            <ext:Label ID="Label1" runat="server" Text="月"></ext:Label>
                                        </Items>
                                    </ext:CompositeField>
                                </Items>
                            </ext:Container>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_Inuser_Name" FieldLabel="定制人" ReadOnly="true" AnchorHorizontal="0.95" />
                                    <ext:Hidden runat="server" ID="exthidn_InUser" />
                                    <ext:ComboBox runat="server" ID="extcomb_Customer" AllowBlank="false" FieldLabel="客户"
                                        DisplayField="CustomerName" ValueField="CustomerId" AnchorHorizontal="0.95" PageSize="10">
                                        <Store>
                                            <ext:Store runat="server" ID="Store_CustomId" AutoLoad="true">
                                                <Reader>
                                                     <ext:JsonReader IDProperty="CustomerId">
                                                        <Fields>
                                                            <ext:RecordField Name="CustomerId" />
                                                            <ext:RecordField Name="CustomerName" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                    </ext:ComboBox>
                                    <ext:TextField runat="server" ID="exttxtf_Remark" FieldLabel="备注" MaxLength="400" AnchorHorizontal="0.95" />
                                </Items>
                            </ext:Container>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_InDate" FieldLabel="录入时间" ReadOnly="true" AnchorHorizontal="0.95" />
                                    <ext:NumberField runat="server" ID="extnumf_SumMoney" FieldLabel="总金额" DecimalPrecision="2" AnchorHorizontal="0.95" />
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Panel>
                    <ext:GridPanel runat="server" ID="gridPanel_listdata" RowHeight="1" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true" ClicksToEdit="1" >
                        <ColumnModel>
                            <Columns>
                                <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                <ext:Column Header="<center>商品名称</center>" Width="180" DataIndex="CusCargoName" />
                                <ext:Column Header="<center>规格</center>" Width="80" DataIndex="CusSpec" />
                                <ext:Column Header="<center>型号</center>" Width="80" DataIndex="CusVersion" />
                                <ext:Column Header="<center>厂家</center>" Width="120" DataIndex="CusProduceName" />
                                <ext:Column Header="<center>产地</center>" Width="120" DataIndex="CusArea" />
                                <ext:Column Header="<center>客户商品名称</center>" Width="180" DataIndex="CusCargoName" />
                                <ext:Column Header="<center>客户规格</center>" Width="80" DataIndex="CusSpec" />
                                <ext:Column Header="<center>客户型号</center>" Width="80" DataIndex="CusVersion" />
                                <ext:Column Header="<center>客户厂家</center>" Width="120" DataIndex="CusProduceName" />
                                <ext:Column Header="<center>客户产地</center>" Width="120" DataIndex="CusArea" />
                                <ext:Column Header="<center>批号</center>" Width="120" DataIndex="BatchNo" />
                                <ext:Column Header="<center>数量</center>" Width="80" DataIndex="Count" />
                                <ext:Column Header="<center>单价</center>" Width="120" DataIndex="Supplyprice" />
                                <ext:NumberColumn Header="<center>总金额</center>" Width="120" DataIndex="SumPrice" />
                            </Columns>
                        </ColumnModel>
                        <Store>
                            <ext:Store runat="server" ID="Store1" >
                                <Reader>
                                    <ext:JsonReader IDProperty="DetailId">
                                        <Fields>
                                            <ext:RecordField Name="DetailId" Type="Int" />
                                            <ext:RecordField Name="PayId" Type="Int" />
                                            <ext:RecordField Name="CusCargoName" />
                                            <ext:RecordField Name="CusSpec" />
                                            <ext:RecordField Name="CusVersion" />
                                            <ext:RecordField Name="CusArea" />
                                            <ext:RecordField Name="CusProduceName" />
                                            <ext:RecordField Name="BatchNo" />
                                            <ext:RecordField Name="Sos_No" />
                                            <ext:RecordField Name="Count" />
                                            <ext:RecordField Name="CargoName" />
                                            <ext:RecordField Name="Spec" />
                                            <ext:RecordField Name="Version" />
                                            <ext:RecordField Name="Area" />
                                            <ext:RecordField Name="ProduceName" />
                                            <ext:RecordField Name="Supplyprice" />
                                            <ext:RecordField Name="SumPrice" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <SelectionModel>
                            <ext:RowSelectionModel runat="server" SingleSelect="true" />
                        </SelectionModel>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
